********************************************************************************
/*** Replication file for "Presidents and Vaccines.
	 Head of state inocculation as a tool for vaccine promotion"
	 Frontiers in Public Health, 2024
	 by Lara Collart, Elie Lunanga, Nik Stoop, Marijke Verpoorten
********************************************************************************/


*********************
*** Housekeeping  ***
*********************

	clear all
	set more off 
	set scheme lean1
	
	* analysis relies on three databases
		* "heads_of_state.dta" 			: DB with info on global leaders' vaccine role modelling
		* "replication_vaccine.dta"		: DB with main survey questions
		* "replication_vaccine2.dta"	: DB on reasons not to get vaccinated 
		
	* set local directory to folder where data are stored
		cap cd "SET TO LOCAL FOLDER"


***********************************
*** MAIN PAPER TABLES & FIGURES ***
***********************************


*** Figure 1: Heads of state & covid-19 vaccination
	use "heads_of_state.dta",clear 
	tab support if main==1
	tab vaccinated if main==1
	tab image if main==1
	
	
*** Figure 2: Surveyed localities in Lubero
	// see paper
	

*** Figure 3 - Vaccine confidence
	* Panel A 
	use "replication_vaccine.dta", clear 
	sum vacc_imp vacc_eff vacc_safe vacc_rel any_vaccine_kids all_vaccine_kids get_vaccine 
	
	gen z=0
	gen zz=0
	graph hbar (mean) z vacc_imp vacc_eff vacc_safe vacc_rel zz any_vaccine_kids all_vaccine_kids get_vaccine, ascategory  yvaroptions(relabel(1"{bf:Opinion about vaccines}" 2`""{it: Overall I think vaccines are important for children }""' 3`""{it: Overall I think vaccines are effective }""' 4`""{it: Overall I think vaccines are safe }""' 5`""{it: Vaccines are compatible with my religious beliefs }""' 6"{bf:Vaccination behaviour}" 7"Respondent's children received at least one vaccine" 8"Respondent's children received all five vaccines" 9"Respondent would get COVID-19 vaccine if available") label(labsize(small))) blabel(bar,format(%9.2f)) ylabel(0(0.2)1.1)  
	gr_edit plotregion1.barlabels[4].Delete 
	gr_edit plotregion1.barlabels[9].Delete 	
	drop z zz
	graph export Fig3a.pdf,replace	

	* Panel B
	use "replication_vaccine2.dta", clear 
	sum no_confidence side_effects bad_vaccine my_choice no_corona no_need 
	
	graph hbar (mean) no_confidence side_effects my_choice bad_vaccine no_corona no_need, ascategory blabel(bar,format(%9.2f)) ylabel(0(0.1)0.35) yvaroptions(relabel(1"no trust in COVID-19 vaccine" 2"expects (mortal) side effects" 3"personal choice" 4"suspects fake vaccine" 5"COVID-19 does not exist (here)" 6"no need to take vaccine"))
	graph export Fig3b.pdf,replace
	
	

*** Figure 4 - Trust in authorities
	use "replication_vaccine.dta", clear 
	sum interet_autoritelocd interet_adminterritoired interet_gouvprovd interet_gouvnatd interet_presidentd interet_cardinald 
	sum interet_autoriteloc2d interet_adminterritoire2d interet_gouvprov2d interet_gouvnat2d interet_president2d interet_cardinal2d 
	
	gen a=0
	gen b=0 
	gen c=0 
	gen d=0
	gen e=0
	gen f=0
	gen g=0
	gen h=0
	gen i=0
	gen j=0
	gen k=0
	graph hbar (mean) a interet_autoritelocd interet_autoriteloc2d b c interet_adminterritoired interet_adminterritoire2d d e interet_gouvprovd interet_gouvprov2d f g interet_gouvnatd interet_gouvnat2d h i interet_presidentd interet_president2d j k interet_cardinald interet_cardinal2d, ascategory blabel(bar,format(%9.2f)) ylabel(0(0.1)0.53) yvaroptions(relabel(1"{bf:Trust in local authorities}" 5"{bf:Trust in territory authorities}" 9"{bf:Trust in provincial authorities}" 13"{bf:Trust in national authorities}" 17"{bf:Trust in president}" 21"{bf:Trust in cardinal}" 2"{it:in general}" 3"{it:wrt COVID-19}" 4" " 6"{it:in general}" 7"{it:wrt COVID-19}" 8" " 10"{it:in general}" 11"{it:wrt COVID-19}" 12" " 14"{it:in general}" 15"{it:wrt COVID-19}" 16" " 18"{it:in general}" 19"{it:wrt COVID-19}" 20" " 22"{it:in general}" 23"{it:wrt COVID-19}"))	
	foreach v of numlist 23 20 19 16 15 12 11 8 7 4 3{
	gr_edit plotregion1.barlabels[`v'].Delete 		
	}
	drop a b c d e f g h i j k
	graph export Fig4.pdf,replace	

		
		
*** Figure 5 - Survey experiment  
	use "replication_vaccine.dta", clear 
	
	* t-tests 
	ttest get_vaccine,by(exp_pres)
	ttest get_vaccine if interet_president2d==1,by(exp_pres)  
	ttest get_vaccine if interet_president2d==0,by(exp_pres)
		
	* PANEL A
	graph bar (mean) get_vaccine, over(exp_pres, label(angle(stdarrow) labsize(medium))) blabel(bar,format(%9.2f)) subtitle("A. All" "respondents") ytitle("vaccine acceptance") ylabel(0(0.1)0.6) 
	graph save one,replace

	* PANEL B
	graph bar (mean) get_vaccine if interet_president2d==1, over(exp_pres, label(angle(stdarrow) labsize(medium))) blabel(bar,format(%9.2f)) subtitle("B. Respondents" "with trust in president") ytitle(" ") ylabel(0(0.1)0.6) yscale(off fill)
	graph save two,replace	
	
	* PANEL C 
	graph bar (mean) get_vaccine if interet_president2d==0, over(exp_pres, label(angle(stdarrow) labsize(medium))) blabel(bar,format(%9.2f)) subtitle("C. Respondents" "without trust in president") ytitle(" ") ylabel(0(0.1)0.6) yscale(off fill)
	graph save three,replace
		
	graph combine one.gph two.gph three.gph, ycommon xcommon imargin(zero) row(1)
	graph export Fig5abc.pdf,replace
	
	
	* balance in average trust across president treatment 
	tab interet_president2d exp_pres
	table exp_pres, stat(mean interet_president2d)
	ttest interet_president2d, by(exp_pres)
	

	* t-tests cardinal treatment 
	ttest get_vaccine, by(exp_card) 
	ttest get_vaccine if interet_cardinal2d==1,by(exp_card) 
	ttest get_vaccine if interet_cardinal2d==0,by(exp_card) 
	
	* graphs 
	graph bar (mean) get_vaccine, over(exp_card, label(angle(stdarrow) labsize(medium))) blabel(bar,format(%9.2f)) subtitle("D. All" "respondents") ytitle("vaccine acceptance") ylabel(0(0.1)0.6) 
	graph save one,replace

	graph bar (mean) get_vaccine if interet_cardinal2d==1, over(exp_card, label(angle(stdarrow) labsize(medium))) blabel(bar,format(%9.2f)) subtitle("E. Respondents" "with trust in cardinal") ytitle(" ") ylabel(0(0.1)0.6) yscale(off fill)
	graph save two,replace	
	
	graph bar (mean) get_vaccine if interet_cardinal2d==0, over(exp_card, label(angle(stdarrow) labsize(medium))) blabel(bar,format(%9.2f)) subtitle("F. Respondents" "without trust in cardinal") ytitle(" ") ylabel(0(0.1)0.6) yscale(off fill)
	graph save three,replace
	
	graph combine one.gph two.gph three.gph, ycommon xcommon imargin(zero) row(1)
	graph export Fig5def.pdf,replace
		
		
	* balance across groups	
	tab interet_cardinal2d exp_card
	table exp_card, stat(mean interet_cardinal2d)
	ttest interet_cardinal2d, by(exp_card)
	
	
*** Figure 6: media access
	use "replication_vaccine.dta", clear 
	hist lastweek_tv, percent title(TV) xtitle("Nr. days watched TV") xlabel(0(1)7) discrete
	graph save one,replace
	hist lastweek_radio,percent title(Radio) xtitle("Nr. days listened to radio") xlabel(0(1)7) discrete
	graph save two,replace
	graph combine one.gph two.gph, ycommon xcommon imargin(zero) row(1) 
	graph export Fig6.pdf,replace	
	
	tab phone_nr 
	tab phone_use
	tab confiance_mediasociaux

	
*** Figure 7: predictive margins  
	use "replication_vaccine.dta", clear 
	logistic get_vaccine age i.male education i.nande hhsize depratio lnhhyincome i.constr_goodqual i.radio_d i.television_d i.vacc_imp i.vacc_eff i.vacc_safe i.vacc_rel i.exp2##i.interet_president2d i.exp3##i.interet_cardinal2d i.policy_exp i.awareness i.know_uganda lastweek_radio lastweek_tv , cluster(village) 		

	margins exp2#interet_president2d, post atmeans 
	mat margins=e(b)
	svmat margins
	rename (margins1-margins4)(control_trust0 control_trust1 treat_trust0 treat_trust1)

	graph bar (mean) control_trust1 treat_trust1 (mean) control_trust0 treat_trust0, showyvars yvaroptions(relabel(1 "control group" 2"president treatment" 3 "control group" 4"president treatment") gap(50) label(angle(stdarrow))) bar(1, fcolor(gs15)) bar(2, fcolor(gs15)) bar(3, fcolor(gs12)) bar(4, fcolor(gs12)) blabel(bar, size(small) format(%3.2f)) yscale(range(0 0.6)) ylabel(0(0.1)0.6) title ("A. Survey experiment", size(medium)) legend(order(1 "trust in president" 3 "no trust in president")) ytitle("vaccine acceptance")	
	graph export Fig7a.pdf,replace
	
	logistic get_vaccine age i.male education i.nande hhsize depratio lnhhyincome i.constr_goodqual i.radio_d i.television_d i.vacc_imp i.vacc_eff i.vacc_safe i.vacc_rel i.exp2##i.interet_president2d i.exp3##i.interet_cardinal2d i.policy_exp i.awareness i.know_uganda lastweek_radio lastweek_tv , cluster(village) 		

	margins awareness, post atmeans
	mat margins=e(b)
	svmat margins
	rename (margins1-margins2)(aware0 aware1)

	graph bar (mean) aware0 aware1, showyvars yvaroptions(relabel(1 "Not aware" 2"Aware") gap(50) label(angle(stdarrow))) bar(1, fcolor(gs15)) bar(2, fcolor(gs15)) blabel(bar, size(small) format(%3.2f)) yscale(range(0 0.6)) ylabel(0(0.1)0.6) title ("B. Awareness of president's vaccination", size(medium)) legend(off)	ytitle("vaccine acceptance")
	graph export Fig7b.pdf,replace	
	
	pwcorr lastweek_radio awareness,sig
	pwcorr lastweek_tv awareness,sig
	pwcorr lastweek_tv know_uganda,sig
	pwcorr lastweek_radio know_uganda,sig

	
*** Table 1 - Socio-demographic profile of respondent and household
	use "replication_vaccine.dta", clear 
	sum age male education nande hhsize depratio hhyincome radio_d television_d 
	sum lastweek_radio lastweek_tv know_uganda policy_exp awareness 
			
	
*** Table 2: multivariable logistic regressions
	use "replication_vaccine.dta", clear 
	eststo clear
	eststo: logistic get_vaccine age male education nande hhsize depratio lnhhyincome constr_goodqual radio_d television_d vacc_imp vacc_eff vacc_safe vacc_rel exp2 exp3 interet_president2d interet_cardinal2d, cluster(village) 
	eststo: logistic get_vaccine age male education nande hhsize depratio lnhhyincome constr_goodqual radio_d television_d vacc_imp vacc_eff vacc_safe vacc_rel exp2 exp3 interet_president2d interet_cardinal2d exp_pres_trust2 exp_card_trust2, cluster(village) 
	eststo: logistic get_vaccine age male education nande hhsize depratio lnhhyincome constr_goodqual radio_d television_d vacc_imp vacc_eff vacc_safe vacc_rel exp2 exp3 interet_president2d interet_cardinal2d policy_exp, cluster(village) 	
	eststo: logistic get_vaccine age male education nande hhsize depratio lnhhyincome constr_goodqual radio_d television_d vacc_imp vacc_eff vacc_safe vacc_rel exp2 exp3 interet_president2d interet_cardinal2d policy_exp awareness know_uganda lastweek_radio lastweek_tv , cluster(village) 		
	eststo: logistic get_vaccine age male education nande hhsize depratio lnhhyincome constr_goodqual radio_d television_d vacc_imp vacc_eff vacc_safe vacc_rel exp2 exp3 interet_president2d interet_cardinal2d exp_pres_trust2 exp_card_trust2 policy_exp awareness know_uganda lastweek_radio lastweek_tv , cluster(village) 
	
	
	esttab using "Table_2.rtf", eform replace cells(b(star fmt(2)) ci(fmt(2)par)) star(* 0.10 ** 0.05 *** 0.01) nogaps label stats (N r2_p, fmt(%9.0fc %9.2f) labels("FE" "Observations" "Pseudo R2" )) order (exp2 exp3 interet_president2d interet_cardinal2d exp_pres_trust2 exp_card_trust2 policy_exp awareness)  


*********************************
*** APPENDIX TABLES & FIGURES ***
*********************************	

*** Table A1: Leaders' role modelling & COVID-19 vaccination rates
	use "heads_of_state.dta",clear 
	
	gen vaccinated2=0 if vaccinated==0 | vaccinated==99
	replace vaccinated2=1 if vaccinated==1
	
	ttest vac_atleast1, by(support)
	ttest vac_atleast1, by(vaccinated2)
	ttest vac_atleast1, by(image)
	
	ttest vac_protocole1, by(support)
	ttest vac_protocole1, by(vaccinated2)
	ttest vac_protocole1, by(image)	


*** Table A2: Covariate balance in the survey experiment 
	use "replication_vaccine.dta", clear 
	iebaltab age male education nande hhsize depratio hhyincome radio_d television_d interet_president2d interet_cardinal2d, grpvar(exp_pres) savexlsx("exp_pres") ft replace
	iebaltab age male education nande hhsize depratio hhyincome radio_d television_d interet_president2d interet_cardinal2d, grpvar(exp_card) savexlsx("exp_card") ft replace
	
	
*** Table A3: multivariable logistic regressions
	use "replication_vaccine.dta", clear 
	eststo clear
	eststo: logistic get_vaccine age male education nande hhsize depratio lnhhyincome constr_goodqual radio_d television_d vacc_imp vacc_eff vacc_safe vacc_rel exp2 exp3 interet_president2d interet_cardinal2d, cluster(village) 
	eststo: logistic get_vaccine age male education nande hhsize depratio lnhhyincome constr_goodqual radio_d television_d vacc_imp vacc_eff vacc_safe vacc_rel exp2 exp3 interet_president2d interet_cardinal2d exp_pres_trust2 exp_card_trust2, cluster(village) 
	eststo: logistic get_vaccine age male education nande hhsize depratio lnhhyincome constr_goodqual radio_d television_d vacc_imp vacc_eff vacc_safe vacc_rel exp2 exp3 interet_president2d interet_cardinal2d policy_exp, cluster(village) 	
	eststo: logistic get_vaccine age male education nande hhsize depratio lnhhyincome constr_goodqual radio_d television_d vacc_imp vacc_eff vacc_safe vacc_rel exp2 exp3 interet_president2d interet_cardinal2d policy_exp awareness know_uganda lastweek_radio lastweek_tv , cluster(village) 		
	eststo: logistic get_vaccine age male education nande hhsize depratio lnhhyincome constr_goodqual radio_d television_d vacc_imp vacc_eff vacc_safe vacc_rel exp2 exp3 interet_president2d interet_cardinal2d exp_pres_trust2 exp_card_trust2 policy_exp awareness know_uganda lastweek_radio lastweek_tv , cluster(village) 
	
	esttab using "Table_A3.rtf", eform replace cells(b(star fmt(2)) ci(fmt(2)par)) star(* 0.10 ** 0.05 *** 0.01) nogaps label stats (N r2_p, fmt(%9.0fc %9.2f) labels("FE" "Observations" "Pseudo R2" )) order (exp2 exp3 interet_president2d interet_cardinal2d exp_pres_trust2 exp_card_trust2 policy_exp awareness)  					
	

	
***	Table A4: Assessing omitted variable bias 
	use "replication_vaccine.dta", clear 	
	reg get_vaccine age male education nande hhsize depratio lnhhyincome constr_goodqual radio_d television_d vacc_imp vacc_eff vacc_safe vacc_rel exp2 exp3 interet_president2d interet_cardinal2d policy_exp awareness know_uganda lastweek_radio lastweek_tv  ,  cluster(village) 
	di  0.154*1.3
	di 	0.154*2.6
	di 	0.154*3.4	
	psacalc delta awareness, rmax(0.20) mcontrol(policy_exp)
	psacalc delta awareness, rmax(0.40) mcontrol(policy_exp)
	psacalc delta awareness, rmax(0.52) mcontrol(policy_exp)
	
*********************************************************************************

	

	